import request from '@/utils/request'
import { getApiUrl } from '@/utils/request'

export function listArea(query) {
  return request({
    url: '/data/area/list',
    method: 'get',
    params: query
  })
}

export function createArea(data) {
  return request({
    url: '/data/area/create',
    method: 'post',
    data
  })
}

export function readArea(data) {
  return request({
    url: '/data/area/read/' + data.id,
    method: 'get'
  })
}

export function updateArea(data) {
  return request({
    url: '/data/area/update',
    method: 'post',
    data
  })
}

export function deleteArea(data) {
  return request({
    url: '/data/area/delete/' + data.fsiteNo,
    method: 'delete'
  })
}

export function areaOptions(query) {
  return request({
    url: '/data/area/options',
    method: 'get',
    params: query
  })
}

export function fsiteNoBelongOptions(query) {
  return request({
    url: '/data/area/fsiteNoBelongOptions/' + query,
    method: 'get'
  })
}

export function fsiteOptionsByLevel(query) {
  return request({
    url: '/data/area/fsiteOptionsByLevel/' + query,
    method: 'get'
  })
}

export function fsiteOptionsByFsiteNo(query) {
  return request({
    url: '/data/area/fsiteOptionsByFsiteNo/' + query,
    method: 'get'
  })
}

// 获取地点
export function fpointOptions2(query) {
  return request({
    url: '/data/area/fpointOptions2/' + query,
    method: 'get'
  })
}

// 获取教室
export function fpointOptions3(query) {
  return request({
    url: '/data/area/fpointOptions3/' + query,
    method: 'get'
  })
}

// 地点列表
export function getPointOptions(query) {
  return request({
    url: '/data/area/fpointOptions4/' + query,
    method: 'get',
  })
}

export function fpointOptions(query) {
  return request({
    url: '/data/area/fpointOptions/' + query,
    method: 'get'
  })
}

export function schoolOptions(query) {
  return request({
    url: '/data/area/schoolOptions/' + query,
    method: 'get'
  })
}

export function sTsEquipmentOptions() {
  return request({
    url: '/data/area/sTsEquipmentOptions',
    method: 'get'
  })
}

export function sTsEquipmentDictOptions() {
  return request({
    url: '/data/area/sTsEquipmentDictOptions',
    method: 'get'
  })
}

// 下拉框列表
export function getListArea(query) {
  return request({
    url: '/data/area/getList',
    method: 'get',
    params: query
  })
}

// 固定资产码
export function getFequipmentbarcode(query) {
  return request({
    url: '/data/area/getFequipmentbarcode',
    method: 'get',
    params: query
  })
}

// 单据编号
export function getFbillno(query) {
  return request({
    url: '/data/area/getFbillno',
    method: 'get',
    params: query
  })
}

 // 审核接口
 export function checkBiz(query) {
  return request({
    url: '/data/area/checkBiz',
    method: 'get',
    params: query
  })
}

 // 控制指令
 export function eqtActions(feuipmenttype) {
  return request({
    url: '/scene/scenario/eqtActions/' + feuipmenttype,
    method: 'get',
  })
}

 // 审核接口
 export function statusUpdate(data) {
  return request({
    url: '/SqlApi/statusUpdate',
    method: 'post',
    data
  })
}

//正式环境不需要这个/ ; 开发环境需要这个/
const uploadPath2 = getApiUrl() + '/material/tsWarehouse/upload'

const uploadPathHy = getApiUrl() + '/upload'
export { uploadPath2,uploadPathHy }

const uploadPath3 = getApiUrl() + 'material/tsWarehouse/uploadTxt'
export { uploadPath3 }

export function fsiteOptionsByLevel2(data){
  return request({
    url: '/data/area/fsiteOptionsByLevel2/'+data,
    method: 'GET',
  })
}

